/*!
 
 @header HttpClient.h
 
 @abstract 网络层，用于发起请求
 
 @author Created by MXCF on 16/3/21.
 
 @version 1.08 16/3/21 Creation
 
 */


#import "AFHTTPSessionManager.h"
@interface HttpClient : AFHTTPSessionManager{
    
}
@property(nonatomic,strong)NSArray *otherExceptionTypeUrls;
/*!
 *  @brief 单例
 *
 *  @return 返回单例
 */
+(HttpClient*)shareClient;
/*!
 *  @brief post 请求HTTP形式
 *
 *  @param url       请求 url
 *  @param dic       附带的参数信息
 *  @param sucBlock  成功回调
 *  @param failBlock 失败回调
 */
//HTTP形式进行请求
-(void)postWithUrl:(NSString*)url params:(NSDictionary*)dic suc:(void(^)(id results))sucBlock fail:(void(^)(NSString *error,NSInteger status))failBlock;
//HTTP形式进行请求（二级方法）带是否显示loading的传参
-(void)postWithUrl:(NSString*)url params:(NSDictionary*)dic showLoading:(BOOL)showLoading suc:(void(^)(id results))sucBlock fail:(void(^)(NSString *error,NSInteger status))failBlock;
/*!
 *  @brief get 请求
 *
 *  @param url       请求的url
 *  @param dic       参数
 *  @param sucBlock  成功回调
 *  @param failBlock 失败回调
 */
-(void)get:(NSString*)url params:(NSDictionary*)dic suc:(void(^)(id results))sucBlock fail:(void(^)(NSString *error,NSInteger status))failBlock;

/**
 上传图片

 @param image 图片
 @param uploadUrl 上传url
 @param formDataDic 一些参数
 @param sucBlock 成功回调
 @param failBlock 失败回调
 */
-(void)uploadImage:(UIImage*)image url:(NSString*)uploadUrl formDataParam:(NSDictionary*)formDataDic suc:(void(^)(id results))sucBlock fail:(void(^)(NSString *error,NSInteger status))failBlock;

/**
 上传文件

 @param fileData 文件二进制
 @param fileName 文件名字
 @param uploadUrl 上传地址
 @param formDataDic 参数
 @param sucBlock 成功回调
 @param failBlock 失败回调
 */
-(void)uploadFile:(NSData*)fileData fileName:(NSString*)fileName  url:(NSString*)uploadUrl formDataParam:(NSDictionary*)formDataDic suc:(void(^)(id results))sucBlock fail:(void(^)(NSString *error,NSInteger status))failBlock;
@end
